package messengercommon.common;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.ArrayList;
import messengercommon.dto.Message;
import messengercommon.person.Person;

/**
 *
 * @author Samus
 */
public interface ServerRMI extends Remote {

    public static String REBIND_NAME = "SRMI";

    public void addObserver(ClientRMI observer, String nomb) throws RemoteException;

    public int autentifyMessage(Message message) throws RemoteException;

    public int autentifyUser(Person pers, ClientRMI client) throws RemoteException;

    public void userDisconnect(Person pers) throws RemoteException;

    public boolean newUser(Person pers) throws RemoteException;

    public Person userData(String nomb) throws RemoteException;

    public void userDataChanged(Person person) throws RemoteException;

    public void readConList(Person pers) throws RemoteException;

    public int addContact(Person person, String nomb) throws RemoteException; //0 = no existe, 1 = ya está en lista, 2 = todo ok
    
    public ArrayList<String> readLog() throws RemoteException;
}
